/*
    自增自减
 */

public class OperatorDemo05 {
    public static void main(String[] args) {
        //基础操作-单独
    /*
        int i = 0;
        i++;
        System.out.println(i);
        ++i;
        System.out.println(i);

        //基础操作-参与运算
        int j,k;
        j = i++;
        k = ++i;
        //先算再加
        System.out.println(j);
        System.out.println(i);
        //先加再算
        System.out.println(k);
        System.out.println(i);

     */

        //作业: 观察下列代码, 分析程序运行结果
        int i = 10;
        int j = i++ + ++i - i-- + --i + i++ + ++i;
        System.out.println(i);		//12
        System.out.println(j);		//42

    }
}
